<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
    />
    <script src="../lib/flexible.js"></script>
    <link rel="stylesheet" href="../lib/vant.css" />
    <link rel="stylesheet/less" href="../style/index.less" />
    <script src="../lib/less.min.js"></script>
    <script src="../lib/vue.js"></script>
    <script src="../lib/vant.min.js"></script>
    <script src="../js/axios.min.js"></script>
    <script src="../js/base64.min.js"></script>
    <script ignore src="../js/env.js"></script>
    <script ignore src="../js/utils.js"></script>
    <title>一梁一码溯源管理</title>
  </head>
  <body>
    <div id="app">
      <div class="home-flowPath-container">
        <!-- 头部组件 -->
        <div
          class="nav-bar-container"
          :style="{
            paddingTop: (client == 'App' ? statusBarHeight || 20 : 0) + 'px',   
            background: '#385AF9',
          }"
        >
          <van-nav-bar
            @click-left="onClickBack($event)"
            left-arrow
            :style="{ background: '#385AF9'}"
          >
            <template #left>
              <van-icon name="arrow-left" :size="22" color="#FFFFFF" />
            </template>
            <template #title>
              <div class="van-nav-bar-title" :style="{ color: '#FFFFFF' }">
                详情
              </div>
            </template>
          </van-nav-bar>
        </div>
        <div class="detail-container">
          <div class="pull-refresh-container">
            <van-pull-refresh
              :value="loading"
              @refresh="onRefresh"
              ref="pull-refresh"
            >
              <div style="height: 100%">
                <!-- 钢筋加工 -->
                <template v-if="showInfo == 'gj'">
                  <van-cell-group>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">生产开始时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.produceTime }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">生产结束时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.completeTime }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">生产用量</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.produceUsage }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">kg</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">质检人</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.testName }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">质检时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.testTime }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">质检结果</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.testResult == 0 ? "合格"
                          :formData.testResult == 1? "不合格":'' }}
                        </span>
                      </template>
                    </van-cell>
                  </van-cell-group>
                  <van-cell-group
                    class="gj-container"
                    v-for="gj in formData.produceList"
                    :key="gj.id"
                  >
                    <van-cell>
                      <template #title>
                        <span class="custom-title">钢筋型号</span>
                      </template>
                      <template #default>
                        <span class="custom-value"
                          >{{ gj.rebarModelDesc }}</span
                        >
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">钢筋直径</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ gj.rebarDiameterDesc }}</span
                        >
                      </template>
                      <template #extra>
                        <div class="custom-extra">mm</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">钢筋品种</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ gj.rebarTypeDesc }}</span
                        >
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">数量</span>
                      </template>
                      <template #default>
                        <span class="custom-value"> {{ gj.rebarNum }}</span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">kg</div>
                      </template>
                    </van-cell>
                  </van-cell-group>
                </template>
                <!-- 拌和生产 -->
                <template v-if="showInfo == 'bh'">
                  <van-cell-group>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">开始时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.startTime }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">结束时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.endTime }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">总方量</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ Number(formData.totalVolume || 0).toFixed( 2 ) }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">m³</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">总盘数</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.total || 0 }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">盘</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">初级预警</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.chuTotal || 0 }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">盘</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">中级预警</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.zhongTotal || 0 }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">盘</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">高级预警</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.gaoTotal || 0 }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">盘</div>
                      </template>
                    </van-cell>
                  </van-cell-group>
                  <div class="details-button" @click="viewDetails()">
                    <van-icon name="bars" size="20px" />
                    <span class="text"> 查看明细 </span>
                  </div>
                </template>
                <!-- 振捣 -->
                <template v-if="showInfo == 'zd'">
                  <van-cell-group>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">振捣总次数</span>
                      </template>
                      <template #default>
                        <span class="custom-value"> {{ formData.total }} </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">次</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">振捣频率</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.frequency }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">Hz</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">振捣开始时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.startTime }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">振捣结束时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.endTime }}
                        </span>
                      </template>
                    </van-cell>
                  </van-cell-group>
                  <div class="details-button" @click="viewDetails()">
                    <van-icon name="bars" size="20px" />
                    <span class="text"> 查看明细 </span>
                  </div>
                </template>
                <!-- 蒸养 -->
                <template v-if="showInfo == 'zy'">
                  <van-cell-group>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">养生类型</span>
                      </template>
                      <template #default>
                        <span class="custom-value"> 蒸汽 </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">开始时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.minColTime }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">结束时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.maxColTime }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">养生时长</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.hourLength }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">min</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">平均温度</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.avgTmp }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">℃</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">最高温度</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.maxTmp }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">℃</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">最低温度</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.minTmp }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">℃</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">平均湿度</span>
                      </template>
                      <template #default>
                        <span class="custom-value"> {{ formData.avgRh }} </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">%RH</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">最高湿度</span>
                      </template>
                      <template #default>
                        <span class="custom-value"> {{ formData.maxRh }} </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">%RH</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">最低湿度</span>
                      </template>
                      <template #default>
                        <span class="custom-value"> {{ formData.minRh }} </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">%RH</div>
                      </template>
                    </van-cell>
                  </van-cell-group>
                  <div class="details-button" @click="viewDetails()">
                    <van-icon name="bars" size="20px" />
                    <span class="text"> 查看明细 </span>
                  </div>
                </template>
                <!-- 喷淋 -->
                <template v-if="showInfo == 'pl'">
                  <van-cell-group>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">开始时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.minColTime }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">结束时间</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.maxColTime }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">养生时长</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.hourLength }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">min</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">平均温度</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.avgTmp }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">℃</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">最高温度</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.maxTmp }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">℃</div>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">最低温度</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.minTmp }}
                        </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">℃</div>
                      </template>
                    </van-cell>
                  </van-cell-group>
                  <div class="details-button" @click="viewDetails()">
                    <van-icon name="bars" size="20px" />
                    <span class="text"> 查看明细 </span>
                  </div>
                </template>
                <!-- 张拉 -->
                <template v-if="showInfo == 'zl'">
                  <van-cell-group>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">张拉次数</span>
                      </template>
                      <template #default>
                        <span class="custom-value"> {{ formData.total }} </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">合格数</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.qualified }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">不合格数</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.unqualified }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">合格率</span>
                      </template>
                      <template #default>
                        <span class="custom-value"> {{ formData.rate }} </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">%</div>
                      </template>
                    </van-cell>
                  </van-cell-group>
                  <div class="details-button" @click="viewDetails()">
                    <van-icon name="bars" size="20px" />
                    <span class="text"> 查看明细 </span>
                  </div>
                </template>
                <!-- 压浆 -->
                <template v-if="showInfo == 'yj'">
                  <van-cell-group>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">压浆次数</span>
                      </template>
                      <template #default>
                        <span class="custom-value"> {{ formData.total }} </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">合格数</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.qualified }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">不合格数</span>
                      </template>
                      <template #default>
                        <span class="custom-value">
                          {{ formData.unqualified }}
                        </span>
                      </template>
                    </van-cell>
                    <van-cell>
                      <template #title>
                        <span class="custom-title">合格率</span>
                      </template>
                      <template #default>
                        <span class="custom-value"> {{ formData.rate }} </span>
                      </template>
                      <template #extra>
                        <div class="custom-extra">%</div>
                      </template>
                    </van-cell>
                  </van-cell-group>
                  <div class="details-button" @click="viewDetails()">
                    <van-icon name="bars" size="20px" />
                    <span class="text"> 查看明细 </span>
                  </div>
                </template>
              </div>
              <!-- 触底文案 -->
              <div
                class="reach-bottom-container"
                v-if="isReachBottomText && !loading"
              >
                <van-loading size="24px" v-if="!reachBottomFinished">
                  加载中...
                </van-loading>
                <div class="no-more-data" v-else>~没有更多了~</div>
              </div>
            </van-pull-refresh>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
<script type="module">
  var app = new Vue({
    el: "#app",
    data() {
      return {
        //是否处于加载中状态
        loading: false,
        //是否显示触底文案
        isReachBottomText: false,
        //【触底】是否加载结束
        reachBottomFinished: false,
        showInfo: "",
        formData: {},
        rows: {},
        statusBarHeight: 0,
        client: "",
      };
    },
    mounted() {
      this.getInitData();
      this.$nextTick((_) => {
        this.initOperate();
      });
    },
    methods: {
      //查看明细
      viewDetails() {
        let { showInfo } = this;
        let { data = [] } = this.formData || {};
        switch (showInfo) {
          //拌和
          case "bh":
            window.location.href = "../pages/viewBanHeModal.html";
            localStorage.setItem("dataSource", JSON.stringify(data));
            break;
          //振捣
          case "zd":
            window.location.href = "../pages/viewZdModal.html";
            localStorage.setItem("dataSource", JSON.stringify(this.rows));
            break;
          //蒸养
          case "zy":
            window.location.href = "../pages/viewZyModal.html";
            localStorage.setItem("dataSource", JSON.stringify(this.rows));
            break;
          //张拉
          case "zl":
            window.location.href = "../pages/viewZlModal.html";
            localStorage.setItem("dataSource", JSON.stringify(data));
            break;
          //压浆
          case "yj":
            window.location.href = "../pages/viewYjModal.html";
            localStorage.setItem("dataSource", JSON.stringify(data));
            break;
          //喷淋
          case "pl":
            window.location.href = "../pages/viewPlModal.html";
            localStorage.setItem("dataSource", JSON.stringify(this.rows));
            break;

          default:
            break;
        }
      },

      getInitData() {
        this.showInfo = localStorage.getItem("INFO_TYPE");
        this.rows = JSON.parse(localStorage.getItem("ROW_DATA"));
        let { statusBarHeight, client } = getLoginData();
        this.client = client;
        if (client == "App") {
          this.statusBarHeight = statusBarHeight;
        } else {
          this.statusBarHeight = 0;
        }
        this.eventDispatch();
      },

      onClickBack() {
        window.history.back();
      },
      //事件派发
      eventDispatch() {
        this.$toast.loading({
          duration: 0,
          forbidClick: true,
          message: "页面加载中",
        });
        let { showInfo } = this;
        //钢筋加工
        if (showInfo == "gj") {
          this.getGJJGInfo();
        }
        //拌和
        if (showInfo == "bh") {
          this.queryDataByComponentParts();
        }
        //振捣
        if (showInfo == "zd") {
          this.getZDInfo();
        }
        //蒸养
        if (showInfo == "zy") {
          this.getZYInfo();
        }
        //喷淋
        if (showInfo == "pl") {
          this.getPlInfo();
        }
        //张拉
        if (showInfo == "zl") {
          this.getZLInfo();
        }
        //压浆
        if (showInfo == "yj") {
          this.getYJInfo();
        }
      },

      //钢筋加工
      getGJJGInfo() {
        let { token, tenantCode } = getLoginData();
        let { componentParts } = this.rows;
        axios({
          method: "POST",
          headers: {
            Authorization: `Bearer ${token}`,
            Tenantcode: tenantCode,
          },
          url: `${YX_BASE_API_URL}/beam/rebar-process/getByParams`,
          responseType: "json",
          data: {
            componentParts,
          },
        })
          .then((res) => {
            let {
              data: { data },
            } = res;
            this.formData = data?.result ?? {};
          })
          .catch((_) => {
            this.formData = {};
          })
          .finally((_) => {
            setTimeout(() => {
              this.$toast.clear();
            }, 500);
          });
      },

      //拌和(统计、列表)
      queryDataByComponentParts() {
        let { token, tenantCode } = getLoginData();
        let { componentParts } = this.rows;
        return new Promise((resolve, reject) => {
          axios({
            method: "POST",
            headers: {
              Authorization: `Bearer ${token}`,
              Tenantcode: tenantCode,
            },
            url: `${YX_BASE_API_URL}/beam/sn-mp-data/queryDataByComponentParts`,
            responseType: "json",
            data: {
              componentParts,
              tenantCode,
            },
          })
            .then((res) => {
              let {
                data: { data },
              } = res;
              this.formData = data?.result || {};
              resolve();
            })
            .catch((_) => {
              this.formData = {};
              reject();
            })
            .finally((_) => {
              setTimeout(() => {
                this.$toast.clear();
              }, 500);
            });
        });
      },

      //振捣
      getZDInfo() {
        let { token, tenantCode } = getLoginData();
        let { componentParts } = this.rows;
        return new Promise((resolve, reject) => {
          axios({
            method: "POST",
            headers: {
              Authorization: `Bearer ${token}`,
              Tenantcode: tenantCode,
            },
            url: `${YX_BASE_API_URL}/beam/quality-boost-island/cboostDataStatics`,
            responseType: "json",
            data: {
              componentParts,
              tenantCode,
            },
          })
            .then((res) => {
              let {
                data: { data },
              } = res;
              this.formData = data?.result || {};
              resolve();
            })
            .catch((_) => {
              this.formData = {};
              reject();
            })
            .finally((_) => {
              setTimeout(() => {
                this.$toast.clear();
              }, 500);
            });
        });
      },

      //蒸养
      getZYInfo() {
        let { token, tenantCode } = getLoginData();
        let { componentParts } = this.rows;
        axios({
          method: "POST",
          headers: {
            Authorization: `Bearer ${token}`,
            Tenantcode: tenantCode,
          },
          url: `${YX_BASE_API_URL}/beam/quality-ys-data-detail/queryDataByComparts`,
          responseType: "json",
          data: {
            componentParts,
            equType: "17",
          },
        })
          .then((res) => {
            let {
              data: { data },
            } = res;
            this.formData = data?.result || {};
          })
          .catch((_) => {
            this.formData = {};
          })
          .finally((_) => {
            setTimeout(() => {
              this.$toast.clear();
            }, 500);
          });
      },

      //喷淋
      getPlInfo() {
        let { token, tenantCode } = getLoginData();
        let { componentParts } = this.rows;
        axios({
          method: "POST",
          headers: {
            Authorization: `Bearer ${token}`,
            Tenantcode: tenantCode,
          },
          url: `${YX_BASE_API_URL}/beam/quality-ys-data/queryDataByComparts`,
          responseType: "json",
          data: {
            componentParts,
            equType: "18",
          },
        })
          .then((res) => {
            let {
              data: { data },
            } = res;
            this.formData = data?.result || {};
          })
          .catch((_) => {
            this.formData = {};
          })
          .finally((_) => {
            setTimeout(() => {
              this.$toast.clear();
            }, 500);
          });
      },

      //张拉
      getZLInfo() {
        let { token, tenantCode } = getLoginData();
        let { componentParts } = this.rows;
        return new Promise((resolve, reject) => {
          axios({
            method: "POST",
            headers: {
              Authorization: `Bearer ${token}`,
              Tenantcode: tenantCode,
            },
            url: `${YX_BASE_API_URL}/beam/sn-zl/queryDataByComponentParts`,
            responseType: "json",
            data: {
              componentParts,
              tenantCode,
            },
          })
            .then((res) => {
              let {
                data: { data },
              } = res;
              this.formData = data?.result || {};
              resolve();
            })
            .catch((_) => {
              this.formData = {};
              reject();
            })
            .finally((_) => {
              setTimeout(() => {
                this.$toast.clear();
              }, 500);
            });
        });
      },

      //压浆
      getYJInfo() {
        let { token, tenantCode } = getLoginData();
        let { componentParts } = this.rows;
        return new Promise((resolve, reject) => {
          axios({
            method: "POST",
            headers: {
              Authorization: `Bearer ${token}`,
              Tenantcode: tenantCode,
            },
            url: `${YX_BASE_API_URL}/beam/sn-yj/queryDataByComponentParts`,
            responseType: "json",
            data: {
              componentParts,
              tenantCode,
            },
          })
            .then((res) => {
              let {
                data: { data },
              } = res;
              this.formData = data?.result || {};
              resolve();
            })
            .catch((_) => {
              this.formData = {};
              reject();
            })
            .finally((_) => {
              setTimeout(() => {
                this.$toast.clear();
              }, 500);
            });
        });
      },

      //初始化
      initOperate() {
        let scrollview = this.$refs["pull-refresh"]?.$el;
        scrollview.addEventListener(
          "scroll",
          debounce((e) => {
            if (
              Math.ceil(e.target.scrollTop + e.target.clientHeight) >=
              e.target.scrollHeight
            ) {
              //触底
              (!this.reachBottomFinished || !this.isReachBottomText) &&
                this.onReachBottom();
            }
          }, 500),
          true
        );
      },
      clacSize() {
        let scrollview = this.$refs["pull-refresh"]?.$el;
        if (scrollview.scrollHeight <= scrollview.clientHeight) {
          this.isReachBottomText = false;
          return false;
        }
        return true;
      },
      //触底加载
      onReachBottom() {},

      //下拉刷新开启
      onRefresh() {
        this.loading = true;
        Promise.all([this.eventDispatch()]).finally((_) => {
          //关闭下拉刷新
          setTimeout(() => {
            this.loading = false;
          }, 500);
        });
      },
    },
  });
</script>
